#!/usr/bin/env bash
#字符串替换
cmd="xxxx_dxxxx"
a="a"
cmd=${cmd//"_d"/$a}
echo $cmd
#数组
ar[0]=1
ar[1]="2"
length=${#ar[@]} #@和*表示所有
lengthn=${#ar[1]}
echo "length $length"
echo "lengthn $lengthn"
for i in ${ar[*]};
do  
    echo "i $i"
    #echo ${ar[i]}
done